package cn.edu.hqu.cst.android.sensor;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        Button accelsimulator_btn = findViewById(R.id.AccelSimulatorBtn);
        Button sensorsimulation_btn = findViewById(R.id.SensorSimulationBtn);
        Button compass_btn = findViewById(R.id.CompassBtn);
        //跳转加速度模拟页面
        accelsimulator_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MainActivity.this,AccelSimulator.class);
                startActivity(i);
            }
        });
        //跳转传感器模拟页面
        sensorsimulation_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent j = new Intent(MainActivity.this,SensorSimulation.class);
                startActivity(j);
            }
        });
        //跳转指南针页面
        compass_btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent k = new Intent(MainActivity.this,Compass.class);
                startActivity(k);
            }
        });
    }
}
